<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:icecore="http://www.icefaces.org/icefaces/core"
       xmlns:ace="http://www.icefaces.org/icefaces/components"
       xmlns:ice="http://www.icesoft.com/icefaces/component"
       >      
    <h:head>
        <title><h:form><h:outputText>Übungsblätter Kategorien bearbeiten</h:outputText></h:form></title>
    </h:head>
    <h:body>
        <ui:composition template="WEB-INF/templates/lecture.xhtml">                        
            <ui:define name="content">
                <ice:outputText value="Kategorien für Übungsblätter erstellen und bearbeiten" />
                <br />
                <br />
                <h:form>
                    <ice:commandButton value="Neue Kategorie"
                                       action="#{lectureBean.lecture.createTaskCategory()}" />
                </h:form>
                <br />
                <br />
                <ice:dataTable value="#{lectureBean.lecture.exerciseCategories}"
                               var="row">
                    <ice:columnGroup>
                        <ice:headerRow>
                            <ice:column rowspan="2">
                                Test
                            </ice:column>
                            <ice:column rowspan="2">
                                Test 2
                            </ice:column>
                        </ice:headerRow>
                        <ice:headerRow>
                            <ice:column>
                                Unterer Test
                            </ice:column>
                        </ice:headerRow>
                    </ice:columnGroup>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Name" /></f:facet>
                        <h:form>
                            <ice:inputText value="#{row.name}"
                                             partialSubmit="true" />
                        </h:form>     
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Gewichtung (in Prozent)" /></f:facet>
                        <h:form>
                            <ice:inputText value="#{row.weight}"
                                           partialSubmit="true"/>
                        </h:form>
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Anforderung (in Prozent)" /></f:facet>
                        <h:form>
                            <ice:inputText value="#{row.requirement}"
                                           partialSubmit="true" />
                        </h:form>    
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Löschen" /></f:facet>
                        <h:form>
                            <ice:commandButton value="Löschen"
                                               action="#{lectureBean.lecture.removeTaskCategory(row)}" />
                        </h:form>
                    </ice:column>
                </ice:dataTable>
            </ui:define>
        </ui:composition>
    </h:body>
</html>